package com.yunxin.mybatisplus.bean;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * Description: 默认的序列化配置
 *
 * @Author sbx
 * @Create 2025/9/8 13:31
 */
@ConfigurationProperties(prefix = "serialize.decimal")
@Component
@Data
public class DecimalSerializeProperties {

    /**
     * 默认保留小数位数
     */
    public static final Integer DEFAULT_SCALE = 2;
    /**
     * 默认舍入模式
     */
    public static final String DEFAULT_ROUNDING_MODE = "HALF_UP";
    /**
     * 默认时间格式
     */
    public static final String DEFAULT_DATE_FORMAT = "yyyy-MM-dd HH:mm:ss";
    /**
     * 默认时区
     */
    public static final String DEFAULT_TIME_ZONE = "GMT+8";


    /**
     * 默认保留小数位数
     */
    private Integer defaultScale = DEFAULT_SCALE;

    /**
     * 舍入模式，默认 HALF_UP
     * 支持：UP, DOWN, CEILING, FLOOR, HALF_UP, HALF_DOWN, HALF_EVEN
     */
    private String roundingMode = DEFAULT_ROUNDING_MODE;

    /**
     * 时间格式
     */
    private String dateFormat = DEFAULT_DATE_FORMAT;
    /**
     * 时间区域
     */
    private String timeZone = DEFAULT_TIME_ZONE;
}
